<%--
  Created by IntelliJ IDEA.
  User: 86131
  Date: 2021/9/1
  Time: 15:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>管理员界面</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->

    <!-- Bootstrap -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
    <script src="js/jquery.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="font/iconfont.css">
    <script src="js/message.js"></script>
</head>
<body>
<%--火车车次管理--%>
<div class="container">
    <table class="table table-hover">
        <%--            表格头--%>
        <tr class="success">
            <th>编号</th>
            <th>车次</th>
            <th>始发站</th>
            <th>终点站</th>
            <th>发时</th>
            <th>到时</th>
            <th>操作</th>
        </tr>
        <%--    获取 到的真实数据--%>
        <c:forEach items="${trainNumberList}" var="trainNumber" varStatus="s">
            <tr>
                <td>${s.count}</td>
                <td>${trainNumber.trainNumber}</td>
                <td>${trainNumber.startStation}</td>
                <td>${trainNumber.endStation}</td>
                <td>${trainNumber.startTime}</td>
                <td>${trainNumber.endTime}</td>
                <td><a class="btn btn-default btn-sm" href="${pageContext.request.contextPath}/TrainRunningTimeServlet?trainNumber=${trainNumber.trainNumber}">列车时刻表</a>
                    <a class="btn btn-default btn-sm"
                       onclick="confirm({
                               title: '删除车次',
                               content: '你确定吗',
                               doneText: '那当然',
                               cancalText: '不是的'
                               }).then(() => {
                               console.log('已确认')
                               window.open('${pageContext.request.contextPath}/DeleteTrainNumberServlet?trainNumber=${trainNumber.trainNumber}','_self');
                               }).catch(() => {
                               console.log('已取消')
                               })"
                       >删除</a></td>

            </tr>
        </c:forEach>
    </table>
</div>
</body>
</html>
